﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Maticsoft.DBUtility;

namespace EnterpriseFund.DAL
{
    public class HREmpl
    {
        /// <summary>
        /// 根据员工编号从V_HREmpl中获得数据列表
        /// <creator>zhongyl</creator>
        /// <date>2013-07-18</date>
        /// </summary>
        /// <param name="emplNo">员工</param>
        /// <param name="entityNo">公司编号</param>
        /// <returns>DataSet对象</returns>
        public DataSet GetEmplFromViewByEmplNo(string emplNo, string entityNo)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select FEntityNo, FEmplNo, FEmpName, FDeptNo, FDeptName ,FPositionNo,FIsMainPosition ");
            strSql.Append(" FROM v_HREmpl ");
            strSql.Append(" where FEntityNo=@FEntityNo and FEmplNo=@FEmplNo");
            SqlParameter[] parameters = {
                   new SqlParameter("@FEntityNo",SqlDbType.VarChar,50),
                   new SqlParameter("@FEmplNo",SqlDbType.NVarChar,50)};
            parameters[0].Value = entityNo;
            parameters[1].Value = emplNo;
            return DbHelperSQL.Query(strSql.ToString(), parameters);
        }
    }
}
